﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="WebScripting2013._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <p>
        &nbsp;</p>
<p>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="CarsDb" AllowSorting="True">
        <Columns>
            <asp:BoundField DataField="ModelYear" HeaderText="ModelYear" 
                SortExpression="ModelYear" />
            <asp:BoundField DataField="CC" HeaderText="CC" SortExpression="CC" />
            <asp:BoundField DataField="Make" HeaderText="Make" SortExpression="Make" />
            <asp:BoundField DataField="Condition" HeaderText="Condition" 
                SortExpression="Condition" />
            <asp:BoundField DataField="Color" HeaderText="Color" SortExpression="Color" />
            <asp:BoundField DataField="Registration" HeaderText="Registration" 
                SortExpression="Registration" />
            <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
            <asp:BoundField DataField="ContactNumber" HeaderText="ContactNumber" 
                SortExpression="ContactNumber" />
            <asp:ImageField DataImageUrlField="Picture" HeaderText="Photo">
                <ControlStyle Height="100px" Width="100px" />
            </asp:ImageField>
            <asp:HyperLinkField DataNavigateUrlFields="InfoUrl" 
                 DataNavigateUrlFormatString="{0}" DataTextField="ModelName" HeaderText="Info" />
            <asp:HyperLinkField DataNavigateUrlFields="SellerPostCode" 
                DataNavigateUrlFormatString="http://maps.google.co.uk/?q={0}" 
                DataTextField="SellerPostCode" HeaderText="Location" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="detail.aspx?ID={0}" HeaderText="Detail" 
                Text="Detail" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="CarsDb" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CarsConn %>" 
        ProviderName="<%$ ConnectionStrings:CarsConn.ProviderName %>" 
        SelectCommand="SELECT * FROM [ClassicCars]"></asp:SqlDataSource>
</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
</asp:Content>
